<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('生产型号列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>生产型号：</label>
                                <input type="text" name="modeNo"/>
                            </li>
                            <li>
                                <label>型号名称：</label>
                                <input type="text" name="modeName"/>
                            </li>
                            <li>
                                <label>产品分类：</label>
                                <select name="modeType" th:with="type=${@dict.getType('erp_mode_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>长度：</label>
                                <input type="text" name="length"/>
                            </li>
                            <li>
                                <label>宽度：</label>
                                <input type="text" name="wide"/>
                            </li>
                            <li>
                                <label>版厚：</label>
                                <select name="thickness" th:with="type=${@dict.getType('erp_thickness')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>层数：</label>
                                <select name="layerNum" th:with="type=${@dict.getType('erp_layer_num')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>基材：</label>
                                <select name="baseMaterial" th:with="type=${@dict.getType('erp_baseMaterial')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>外层铜厚：</label>
                                <select name="outerThickness" th:with="type=${@dict.getType('erp_outerThickness')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>内层铜厚：</label>
                                <select name="innerThickness" th:with="type=${@dict.getType('erp_outerThickness')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>焊盘喷镀：</label>
                                <select name="solderCoating" th:with="type=${@dict.getType('erp_solderCoating')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>阻焊颜色：</label>
                                <select name="solderColor" th:with="type=${@dict.getType('erp_solderColor')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>字符颜色：</label>
                                <select name="characterColor" th:with="type=${@dict.getType('erp_characterColor')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>成形：</label>
                                <select name="shapingStyle" th:with="type=${@dict.getType('erp_shapingStyle')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>测试：</label>
                                <select name="testStyle" th:with="type=${@dict.getType('erp_testStyle')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>过孔：</label>
                                <select name="viaHole" th:with="type=${@dict.getType('erp_viaHole')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>规格：</label>
                                <input type="text" name="spec"/>
                            </li>
                            <li>
                                <label>单元尺寸：</label>
                                <input type="text" name="unitSize"/>
                            </li>
                            <li>
                                <label>拼版尺寸：</label>
                                <input type="text" name="makeUpSize"/>
                            </li>
                            <li>
                                <label>拼板款数：</label>
                                <input type="text" name="makeModeNum"/>
                            </li>
                            <li>
                                <label>是否阻抗：</label>
                                <select name="isImpedance" th:with="type=${@dict.getType('sys_yes_no')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>阻焊覆盖：</label>
                                <input type="text" name="solderCover"/>
                            </li>
                            <li>
                                <label>需要斜边：</label>
                                <select name="hypotenuse" th:with="type=${@dict.getType('sys_yes_no')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>创建者：</label>
                                <input type="text" name="createBy"/>
                            </li>
                            <li class="select-time">
                                <label>创建时间：</label>
                                <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
                                <span>-</span>
                                <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:erpModel:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="erp:erpModel:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="erp:erpModel:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:erpModel:export">
                    <i class="fa fa-download"></i> 导出
                </a>
                <a class="btn btn-info single disabled" onclick="$.operate.detail()">
                    <i class="fa fa-search"></i> 详细
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('erp:erpModel:edit')}]];
        var removeFlag = [[${@permission.hasPermi('erp:erpModel:remove')}]];
        var modeTypeDatas = [[${@dict.getType('erp_mode_type')}]];
        var thicknessDatas = [[${@dict.getType('erp_thickness')}]];
        var layerNumDatas = [[${@dict.getType('erp_layer_num')}]];
        var baseMaterialDatas = [[${@dict.getType('erp_baseMaterial')}]];
        var outerThicknessDatas = [[${@dict.getType('erp_outerThickness')}]];
        var innerThicknessDatas = [[${@dict.getType('erp_outerThickness')}]];
        var solderCoatingDatas = [[${@dict.getType('erp_solderCoating')}]];
        var solderColorDatas = [[${@dict.getType('erp_solderColor')}]];
        var characterColorDatas = [[${@dict.getType('erp_characterColor')}]];
        var shapingStyleDatas = [[${@dict.getType('erp_shapingStyle')}]];
        var testStyleDatas = [[${@dict.getType('erp_testStyle')}]];
        var viaHoleDatas = [[${@dict.getType('erp_viaHole')}]];
        var isImpedanceDatas = [[${@dict.getType('sys_yes_no')}]];
        var hypotenuseDatas = [[${@dict.getType('sys_yes_no')}]];
        var prefix = ctx + "erp/erpModel";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                detailUrl: prefix + "/detail/{id}",
                modalName: "生产型号",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键ID',
                    visible: false
                },
                {
                    field: 'modeNo',
                    title: '生产型号'
                },
                    {
                        field: 'modeName',
                        title: '生产型号名称'
                    },
                {
                    field: 'modeType',
                    title: '产品分类',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(modeTypeDatas, value);
                    }
                },
                {
                    field: 'pcbFile',
                    title: '生产pcb文件',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-xs" href="' + row.pcbFile + '"><i class="fa fa-download"></i>下载</a> ');
                        return actions.join('');
                    }
                },
                {
                    field: 'machineFile',
                    title: '生产机器文件',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-xs" href="' + row.machineFile + '"><i class="fa fa-download"></i>下载</a> ');
                        return actions.join('');
                    }
                },
                {
                    field: 'length',
                    title: '长度'
                },
                {
                    field: 'wide',
                    title: '宽度'
                },
                {
                    field: 'thickness',
                    title: '版厚',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(thicknessDatas, value);
                    }
                },
                {
                    field: 'layerNum',
                    title: '层数',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(layerNumDatas, value);
                    }
                },
                {
                    field: 'baseMaterial',
                    title: '基材',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(baseMaterialDatas, value);
                    }
                },
                {
                    field: 'outerThickness',
                    title: '外层铜厚',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(outerThicknessDatas, value);
                    }
                },
                {
                    field: 'innerThickness',
                    title: '内层铜厚',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(innerThicknessDatas, value);
                    }
                },
                {
                    field: 'solderCoating',
                    title: '焊盘喷镀',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(solderCoatingDatas, value);
                    }
                },
                {
                    field: 'solderColor',
                    title: '阻焊颜色',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(solderColorDatas, value);
                    }
                },
                {
                    field: 'characterColor',
                    title: '字符颜色',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(characterColorDatas, value);
                    }
                },
                {
                    field: 'shapingStyle',
                    title: '成形',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(shapingStyleDatas, value);
                    }
                },
                {
                    field: 'testStyle',
                    title: '测试',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(testStyleDatas, value);
                    }
                },
                {
                    field: 'viaHole',
                    title: '过孔',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(viaHoleDatas, value);
                    }
                },
                {
                    field: 'spec',
                    title: '规格'
                },
                {
                    field: 'unitSize',
                    title: '单元尺寸'
                },
                {
                    field: 'makeUpSize',
                    title: '拼版尺寸'
                },
                {
                    field: 'createBy',
                    title: '创建者'
                },
                {
                    field: 'createTime',
                    title: '创建时间'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>